#include <cmath>

#include "custom_utils.h"

double distance(Particle * p1, Particle * p2) {
    return sqrt((p2 -> get_x() - p1 -> get_x()) * (p2 -> get_x() - p1 -> get_x())
        + (p2 -> get_y() - p1 -> get_y()) * (p2 -> get_y() - p1 -> get_y()));
}

double distance(double x1, double y1, double x2, double y2) {
    return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
}

double distanceSq(double x1, double y1, double x2, double y2) {
    return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
